<template>
  <n-form label-width="auto" label-placement="left" size="small">
    <n-form-item label="原密码" show-require-mark>
      <n-input type="password" v-model:value="form.oldPassword" />
    </n-form-item>
    <n-form-item label="新密码" show-require-mark>
      <n-input type="password" v-model:value="form.newPassword" />
    </n-form-item>
    <n-form-item label="确认密码" show-require-mark>
      <n-input type="password" v-model:value="form.confirmPassword" />
    </n-form-item>
    <n-form-item label=" ">
      <n-button size="medium" type="info" @click="handleSaveOnClick">保存</n-button>
    </n-form-item>
  </n-form>
</template>
<script lang="ts" setup>
import { putPassword } from '@/api/base/User'

let form = reactive({} as PasswordDto)

const handleSaveOnClick = async () => {
  await putPassword(form)
  Object.keys(form).forEach((key) => {
    form[key] = null
  })
}

</script>